package com.ethan.date;

import java.util.Calendar;
import java.util.Date;

/**
 * @author ethan
 * create 2018-05-09 上午11:33
 * desc
 **/
public class DateTest {
    public static void main(String[] args){

        String s="";
    }

    /**
     * 获取当前系统时间前一天
     * @param date
     * @return
     */
    public static Date getDay(Date date,int num) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.add(Calendar.DAY_OF_MONTH, num);
        date = calendar.getTime();
        return date;
    }
}
